<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>{:@date('Y-m-d', $menu['menu_date'])} 菜谱管理</h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span>菜品列表</span></a></li>
        <li><a href="{:U('add?menu_id='.$menu['menu_id'])}" ><span>新增菜品</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" action="{:U()}" name="form_search">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th>菜单日期：{:@date('Y-m-d', $menu['menu_date'])}</th>
        </tr>
        <tr>
          <th>售卖区域：{$area[$menu['area_id']]}</th>
        </tr>
      </tbody>
    </table>
  </form>
<table class="table tb-type2" id="prompt">
	<tbody>
		<tr class="space odd">
			<th colspan="12"><div class="title"><h5>操作提示</h5><span class="arrow"></span></div></th>
		</tr>
		<tr>
			<td><ul><li></li></ul></td>
		</tr>
	</tbody>
</table>
	<form method="post" id="form1">
    <table class="table tb-type2">
      <thead>
        <tr class="thead">
          <th class="w24"></th>
          <th colspan="2">商品名称</th>
          <th class="w108 align-center">店铺名称</th>
          <th class="w108 align-center">库存总量</th>
          <th class="w108 align-center">已销售</th>
          <th class="w108 align-center">库存活动-开始</th>
          <th class="w108 align-center">库存活动-中</th>
          <th class="w108 align-center">库存活动-结束</th>
          <th class="w108 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="vo">
        <tr class="hover">
          <td><input type="checkbox" name='id[]' value="{$vo['id']}" class="checkitem"></td>
          <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><img src="{$goods[$vo['goods_id']]['goods_image']}" onload="javascript:DrawImage(this,56,56);"/></span></div></td>
          <td class="goods-name">
            <p><span>{$goods[$vo['goods_id']]['goods_name']}</span></p>
            <p class="store"></p>
          </td>
          <td class="align-center">{$store[$goods[$vo['goods_id']]['store_id']]}</td>
          <td class="align-center">{$vo['goods_storage']}</td>
          <php> $skey = C('CACHE_KEY_MENU_GOODS_SELL_NUM') . $menu['menu_id'] . '_' . $vo['goods_id']; </php>
          <php> $num = S($skey); </php>
          <php> $num = empty($num) ? 0 : $num; </php>
          <td class="align-center">{$num}</td>
          <td class="align-center"><p><span>库存>{$vo['storage_two']}</span></p><p><span>立减{$vo['sale_three']}</span></p></td>
          <td class="align-center"><p><span>库存<={$vo['storage_two']}</span></p><p><span>立减{$vo['sale_two']}</span></p></td>
          <td class="align-center"><p><span>库存<={$vo['storage_one']}</span></p><p><span>立减{$vo['sale_one']}</span></p></td>
          <td class="align-center">
          	<a href="{:U('edit', ['id' => $vo['id'], 'menu_id' => $menu['menu_id']])}">编辑</a> |
          	<a href="javascript:if(confirm('您确定要删除吗'))window.location = '{:U('delete?id='.$vo['id'])}';">删除</a>
          </td>
        </tr>
        </volist>
        <else />
        <tr class="no_data">
          <td colspan="10">没有符合条件的记录</td>
        </tr>
        </notempty>
      </tbody>
      <tfoot>
        <tr class="tfoot">
        <notempty name="page">
          <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
          <td colspan="16"><label for="checkallBottom">全选</label>
            &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn" onclick="if(confirm('您确定要删除吗?')){$('#form1').submit();}"><span>删除</span></a>
            <div class="pagination"> {$page} </div></td>
         <else />  
          <td colspan="16"></td>
         </notempty>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript" src="__JS__/jquery-ui/jquery.ui.js"></script>
<script type="text/javascript" src="__JS__/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="__JS__/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
<script type="text/javascript">
$(document).ready(function(){
	$('#sell_time').datepicker({dateFormat: 'yy-mm-dd'});
	$('#deliver_time').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
</block>